< previous page page_635 next page >

Page 635
0635-01.jpg
Figure 17.30
A sphere and a transparent prism.
A light source sends an infinite number of light rays into a scene. Each time one of those rays strikes an object, it sends out an infinite number of other rays in new directions. Many of the new rays follow the angle of reflection closely. Many more follow the path of refraction. Still others head out in nearly every direction, following paths of diffuse reflection or diffuse refraction. Because a computer cannot follow an infinite number of rays, ray-tracing algorithms follow only those rays that are considered the most important. In some cases, the algorithm misses other important rays.
For example, to decide whether a point is shadowed, the program traces a ray from he point back toward each light source. If the ray intersects an object, the program considers the point in the object's shadow. If the object is transparent, however, light should pass through it. Depending on the shape of the object, it may not shadow the point.
A transparent object may also refract light to create a bright spot on some object behind it. Unless the mirror direction at that spot just happens to point back toward the bright parts of the object, the program will not find it.
Similarly, the program misses some of the effects of reflective objects. A shiny surface may reflect light into an object and make it brighter. Unless the object's mirror direction just happens to point back toward the shiny surface, the program will miss this.
This model makes another approximation that is not quite as limiting when it assumes that light at all frequencies travels at the same speed through any given substance. In fact, the index of refraction for different wavelengths of light is different. This is why prisms and rainbows break light into colors. When the light enters a prism, the different wavelengths of light are bent by slightly different amounts because their indexes of refraction differ slightly. Because different wavelengths are bent by different amounts, they leave the prism heading in different directions, and you can see the separated colors. Assuming the indexes of refraction for all wavelengths are the same does not make images appear unnatural, but it does mean your programs cannot easily produce a rainbow.

 
< previous page page_635 next page >